﻿<navigation:Page xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"  x:Class="ATSV2.Views.Teams" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="1024" d:DesignHeight="760"
           Title="ATSV Teams" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices" xmlns:my="clr-namespace:ATSV2.Web.Services" xmlns:my1="clr-namespace:ATSV2.Web">
    <sdk:Page.Resources>
        <CollectionViewSource x:Key="teamSetSpielerSetsViewSource" Source="{Binding Path=Data.SpielerSets, ElementName=teamSetDomainDataSource}" />
    </sdk:Page.Resources>
    <Grid x:Name="LayoutRoot" Background="Black">

        <Image Height="607" HorizontalAlignment="Center" Name="imgBackground" Stretch="Uniform" VerticalAlignment="Center" Width="1024" Source="/ATSV2;component/Images/background.png" />

        <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="12"
                      Width="900" >

            <ScrollViewer.Background>
                <LinearGradientBrush StartPoint="0,0" EndPoint="1,1" >
                    <GradientStop Color="Gray" Offset="0.1" />
                    <GradientStop Color="Silver" Offset="0.25" />
                    <GradientStop Color="WhiteSmoke" Offset="0.75" />
                    <GradientStop Color="White" Offset="1.0" />
                </LinearGradientBrush>
            </ScrollViewer.Background>

            <StackPanel Orientation="Vertical">
                <TextBlock x:Name="TextBox" TextWrapping="Wrap" FontWeight="Bold" FontSize="18" 
                           FontStyle="Italic" Margin="12,12,80,12" Grid.Column="0" Text="Teams">
                  <TextBlock.Effect>
                    <DropShadowEffect BlurRadius="20" Direction="360" ShadowDepth="0" Color="White" />
                  </TextBlock.Effect>
                </TextBlock>

                <riaControls:DomainDataSource AutoLoad="True" d:DesignData="{d:DesignInstance my1:TeamSet, CreateList=true}" Height="0" 
                                              LoadedData="teamSetDomainDataSource_LoadedData" Name="teamSetDomainDataSource" 
                                              QueryName="GetTeamSetsQuery" Width="0">
                    <riaControls:DomainDataSource.DomainContext>
                        <my:ATSVDataContext />
                    </riaControls:DomainDataSource.DomainContext>
                </riaControls:DomainDataSource>

                <toolkit:Accordion ItemsSource="{Binding ElementName=teamSetDomainDataSource, Path=Data}" 
                                   SelectionMode="ZeroOrMore" Width="850" Height="600">
                    <toolkit:Accordion.ItemTemplate>
                        <DataTemplate>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="100" />
                                    <ColumnDefinition Width="*" />
                                </Grid.ColumnDefinitions>
                                
                                <TextBlock Text="{Binding Path=Name, Mode=OneWay}" FontSize="13" Grid.Column="0"/>
                                <StackPanel Orientation="Horizontal" Grid.Column="1">
                                    <TextBlock Text="(" FontSize="11" />
                                    <TextBlock Text="{Binding Path=LigaSet.Name, Mode=OneWay}" FontSize="11" />
                                    <TextBlock Text=")" FontSize="11" />
                                    <TextBlock Text="{Binding Path=TeamTypeSet.Type, Mode=OneWay}" FontSize="11" FontStyle="Italic" />                             
                                </StackPanel>
                               
                            </Grid>
                        </DataTemplate>
                    </toolkit:Accordion.ItemTemplate>
                    <toolkit:Accordion.ContentTemplate>
                        <DataTemplate>
                            <Grid HorizontalAlignment="Left" Name="grid1" VerticalAlignment="Top">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="840" />
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>
                                
                                <StackPanel Orientation="Horizontal" Grid.Column="0" Grid.Row="0" Margin="10,10,0,0" HorizontalAlignment="Left" >
                                    <sdk:Label Content="Ergebnisse:" FontSize="12" FontWeight="Bold" FontStyle="Italic" 
                                               HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
                                    <HyperlinkButton TargetName="_blank" NavigateUri="{Binding Path=Ergebnisse, Mode=OneWay}" VerticalAlignment="Top">
                                        <Image Source="/ATSV2;component/Images/Ergebnisse.png" Height="20" Width="20" />
                                    </HyperlinkButton>
                                    
                                    <sdk:Label Content="Tabelle:" FontSize="12" FontWeight="Bold" FontStyle="Italic" 
                                               HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />    
                                    <HyperlinkButton TargetName="_blank" NavigateUri="{Binding Path=Tabelle, Mode=OneWay}" VerticalAlignment="Top">
                                        <Image Source="/ATSV2;component/Images/Tabelle.png" Height="20" Width="20" />
                                    </HyperlinkButton>
                                    
                                    <sdk:Label Content="Statistik:" FontSize="12" FontWeight="Bold" FontStyle="Italic" 
                                               HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />    
                                    <HyperlinkButton TargetName="_blank" NavigateUri="{Binding Path=Statistik, Mode=OneWay}" VerticalAlignment="Top">
                                        <Image Source="/ATSV2;component/Images/Statistik.png" Height="20" Width="20" />
                                    </HyperlinkButton>
                                    
                                    <sdk:Label Content="Spielplan:" FontSize="12" FontWeight="Bold" FontStyle="Italic" 
                                               HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
                                    <HyperlinkButton TargetName="_blank" NavigateUri="{Binding Path=Spielplan, Mode=OneWay}" VerticalAlignment="Top">
                                        <Image Source="/ATSV2;component/Images/Kalender.png" Height="20" Width="20" />
                                    </HyperlinkButton>
                                </StackPanel>

                                <!--<Image Source="{Binding Path=FotoSet.URL, Mode=OneWay}" Grid.ColumnSpan="2"/>-->
                                <Image Source="/ATSV2;component/Images/He1_Team.jpg" Height="320" Width="450" Grid.Row="1" 
                                       HorizontalAlignment="Left" VerticalAlignment="Top" Margin="5,10,0,0"/>

                                <sdk:DataGrid AutoGenerateColumns="False" Grid.Row="1" Height="300" HorizontalAlignment="Right" VerticalAlignment="Top"
                                              IsReadOnly="True" CanUserResizeColumns="False" Margin="40,10,0,0" Name="spielerSetsDataGrid" RowDetailsVisibilityMode="VisibleWhenSelected" 
                                              ItemsSource="{Binding Path=SpielerSets}" >
                                              
                                              <!--ItemsSource="{Binding Source={StaticResource teamSetSpielerSetsViewSource}}" -->
                                    <sdk:DataGrid.Columns>
                                        <sdk:DataGridTextColumn x:Name="nameColumn" Binding="{Binding Path=Name}" Header="Name" Width="120" />
                                        <sdk:DataGridTextColumn x:Name="vornameColumn" Binding="{Binding Path=Vorname}" Header="Vorname" Width="120" />
                                        <sdk:DataGridTextColumn x:Name="jahrgangColumn" Binding="{Binding Path=Jahrgang}" Header="Jahrgang" Width="80" />
                                    </sdk:DataGrid.Columns>
                                </sdk:DataGrid>


                                <StackPanel Orientation="Horizontal" Grid.Row="2" VerticalAlignment="Center" Margin="0,10,20,0" HorizontalAlignment="Right" >
                                    <sdk:Label Height="23" Content="Trainer:" FontSize="11" VerticalAlignment="Top"/>
                                    <TextBlock Height="23" Text="{Binding Path=TrainerSet.Name, Mode=OneWay}" FontSize="11"  VerticalAlignment="Top" />
                                    <TextBlock Text="," FontSize="11" VerticalAlignment="Top"/>
                                    <TextBlock Height="23" Text="{Binding Path=TrainerSet.Vorname, Mode=OneWay}" FontSize="11" VerticalAlignment="Top" />
                                </StackPanel>
                            </Grid>
                        </DataTemplate>
                    </toolkit:Accordion.ContentTemplate>
                </toolkit:Accordion>

            </StackPanel>
        </ScrollViewer>
        
    </Grid>
</navigation:Page>
